3.258 \(\int \frac{(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx\)

Optimal. Leaf size=75 \[ -\frac{2 f (e+f x) \sin (c+d x)}{a d^2}-\frac{2 f^2 \cos (c+d x)}{a d^3}+\frac{(e+f x)^2 \cos (c+d x)}{a d}+\frac{(e+f x)^3}{3 a f} \]

[Out]

(e + f*x)^3/(3*a*f) - (2*f^2*Cos[c + d*x])/(a*d^3) + ((e + f*x)^2*Cos[c + d*x])/(a*d) - (2*f*(e + f*x)*Sin[c +
 d*x])/(a*d^2)

________________________________________________________________________________________

Rubi [A]  time = 0.114828, antiderivative size = 75, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4523, 32, 3296, 2638} \[ -\frac{2 f (e+f x) \sin (c+d x)}{a d^2}-\frac{2 f^2 \cos (c+d x)}{a d^3}+\frac{(e+f x)^2 \cos (c+d x)}{a d}+\frac{(e+f x)^3}{3 a f} \]

Antiderivative was successfully verified.

[In]

Int[((e + f*x)^2*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

(e + f*x)^3/(3*a*f) - (2*f^2*Cos[c + d*x])/(a*d^3) + ((e + f*x)^2*Cos[c + d*x])/(a*d) - (2*f*(e + f*x)*Sin[c +
 d*x])/(a*d^2)

Rule 4523

Int[(Cos[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]), x_Symbol
] :> Dist[1/a, Int[(e + f*x)^m*Cos[c + d*x]^(n - 2), x], x] - Dist[1/b, Int[(e + f*x)^m*Cos[c + d*x]^(n - 2)*S
in[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^2 - b^2, 0]

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac{\int (e+f x)^2 \, dx}{a}-\frac{\int (e+f x)^2 \sin (c+d x) \, dx}{a}\\ &=\frac{(e+f x)^3}{3 a f}+\frac{(e+f x)^2 \cos (c+d x)}{a d}-\frac{(2 f) \int (e+f x) \cos (c+d x) \, dx}{a d}\\ &=\frac{(e+f x)^3}{3 a f}+\frac{(e+f x)^2 \cos (c+d x)}{a d}-\frac{2 f (e+f x) \sin (c+d x)}{a d^2}+\frac{\left (2 f^2\right ) \int \sin (c+d x) \, dx}{a d^2}\\ &=\frac{(e+f x)^3}{3 a f}-\frac{2 f^2 \cos (c+d x)}{a d^3}+\frac{(e+f x)^2 \cos (c+d x)}{a d}-\frac{2 f (e+f x) \sin (c+d x)}{a d^2}\\ \end{align*}

Mathematica [A]  time = 0.423374, size = 74, normalized size = 0.99 \[ \frac{3 \cos (c+d x) \left (d^2 (e+f x)^2-2 f^2\right )-6 d f (e+f x) \sin (c+d x)+d^3 x \left (3 e^2+3 e f x+f^2 x^2\right )}{3 a d^3} \]

Antiderivative was successfully verified.

[In]

Integrate[((e + f*x)^2*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

(d^3*x*(3*e^2 + 3*e*f*x + f^2*x^2) + 3*(-2*f^2 + d^2*(e + f*x)^2)*Cos[c + d*x] - 6*d*f*(e + f*x)*Sin[c + d*x])
/(3*a*d^3)

________________________________________________________________________________________

Maple [B]  time = 0.059, size = 215, normalized size = 2.9 \begin{align*} -{\frac{1}{a{d}^{3}} \left ({f}^{2} \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) -2\,c{f}^{2} \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) +2\,def \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) -{c}^{2}{f}^{2}\cos \left ( dx+c \right ) +2\,cdef\cos \left ( dx+c \right ) -{d}^{2}{e}^{2}\cos \left ( dx+c \right ) -{\frac{{f}^{2} \left ( dx+c \right ) ^{3}}{3}}+c{f}^{2} \left ( dx+c \right ) ^{2}-def \left ( dx+c \right ) ^{2}-{c}^{2}{f}^{2} \left ( dx+c \right ) +2\,cdef \left ( dx+c \right ) -{d}^{2}{e}^{2} \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x+e)^2*cos(d*x+c)^2/(a+a*sin(d*x+c)),x)

[Out]

-1/d^3/a*(f^2*(-(d*x+c)^2*cos(d*x+c)+2*cos(d*x+c)+2*(d*x+c)*sin(d*x+c))-2*c*f^2*(sin(d*x+c)-(d*x+c)*cos(d*x+c)
)+2*d*e*f*(sin(d*x+c)-(d*x+c)*cos(d*x+c))-c^2*f^2*cos(d*x+c)+2*c*d*e*f*cos(d*x+c)-d^2*e^2*cos(d*x+c)-1/3*f^2*(
d*x+c)^3+c*f^2*(d*x+c)^2-d*e*f*(d*x+c)^2-c^2*f^2*(d*x+c)+2*c*d*e*f*(d*x+c)-d^2*e^2*(d*x+c))

________________________________________________________________________________________

Maxima [B]  time = 1.56341, size = 417, normalized size = 5.56 \begin{align*} \frac{6 \, c^{2} f^{2}{\left (\frac{1}{a d^{2} + \frac{a d^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac{\arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d^{2}}\right )} - 12 \, c e f{\left (\frac{1}{a d + \frac{a d \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac{\arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d}\right )} + 6 \, e^{2}{\left (\frac{\arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac{1}{a + \frac{a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}\right )} + \frac{3 \,{\left ({\left (d x + c\right )}^{2} + 2 \,{\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} e f}{a d} - \frac{3 \,{\left ({\left (d x + c\right )}^{2} + 2 \,{\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} c f^{2}}{a d^{2}} + \frac{{\left ({\left (d x + c\right )}^{3} + 3 \,{\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 6 \,{\left (d x + c\right )} \sin \left (d x + c\right )\right )} f^{2}}{a d^{2}}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/3*(6*c^2*f^2*(1/(a*d^2 + a*d^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(cos(d*x + c) + 1)
)/(a*d^2)) - 12*c*e*f*(1/(a*d + a*d*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(cos(d*x + c) +
 1))/(a*d)) + 6*e^2*(arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + 1/(a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)
) + 3*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c))*e*f/(a*d) - 3*((d*x + c)^2 + 2*(d*x + c)*cos(d
*x + c) - 2*sin(d*x + c))*c*f^2/(a*d^2) + ((d*x + c)^3 + 3*((d*x + c)^2 - 2)*cos(d*x + c) - 6*(d*x + c)*sin(d*
x + c))*f^2/(a*d^2))/d

________________________________________________________________________________________

Fricas [A]  time = 1.75602, size = 209, normalized size = 2.79 \begin{align*} \frac{d^{3} f^{2} x^{3} + 3 \, d^{3} e f x^{2} + 3 \, d^{3} e^{2} x + 3 \,{\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + d^{2} e^{2} - 2 \, f^{2}\right )} \cos \left (d x + c\right ) - 6 \,{\left (d f^{2} x + d e f\right )} \sin \left (d x + c\right )}{3 \, a d^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/3*(d^3*f^2*x^3 + 3*d^3*e*f*x^2 + 3*d^3*e^2*x + 3*(d^2*f^2*x^2 + 2*d^2*e*f*x + d^2*e^2 - 2*f^2)*cos(d*x + c)
- 6*(d*f^2*x + d*e*f)*sin(d*x + c))/(a*d^3)

________________________________________________________________________________________

Sympy [A]  time = 8.52252, size = 770, normalized size = 10.27 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)**2*cos(d*x+c)**2/(a+a*sin(d*x+c)),x)

[Out]

Piecewise((3*d**3*e**2*x*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 3*d**3*e**2*x/(3*a*d*
*3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 3*d**3*e*f*x**2*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d
**3) + 3*d**3*e*f*x**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + d**3*f**2*x**3*tan(c/2 + d*x/2)**2/(3*a*d**
3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + d**3*f**2*x**3/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) - 3*d**2*e**2*tan
(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 3*d**2*e**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d
**3) - 6*d**2*e*f*x*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 6*d**2*e*f*x/(3*a*d**3*tan
(c/2 + d*x/2)**2 + 3*a*d**3) - 3*d**2*f**2*x**2*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3)
+ 3*d**2*f**2*x**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 6*d*e*f*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 +
 d*x/2)**2 + 3*a*d**3) - 12*d*e*f*tan(c/2 + d*x/2)/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 6*d*e*f/(3*a*d*
*3*tan(c/2 + d*x/2)**2 + 3*a*d**3) - 12*d*f**2*x*tan(c/2 + d*x/2)/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) +
6*f**2*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) - 6*f**2/(3*a*d**3*tan(c/2 + d*x/2)**2 +
3*a*d**3), Ne(d, 0)), ((e**2*x + e*f*x**2 + f**2*x**3/3)*cos(c)**2/(a*sin(c) + a), True))

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError